import request from '@/utils/request'

export const regAPI = obj => {
  return request.post('/api/reg', obj)
}

export const loginAPI = obj => {
  return request.post('/api/login', obj)
}

// 获取用户信息
export const getUserAPI = () => {
  return request.get('/my/userinfo')
}

// 更新用户数据
export const updateUserAPI = data => {
  // return request.put('/my/userinfo', 请求体)
  return request.put('/my/userinfo', data)
}

// 更新用户密码
export const updatePwdAPI = data => {
  return request.patch('/my/updatepwd', data)
}

// 更新头像
export const updateAvatarAPI = str => {
  return request.patch('/my/update/avatar', { avatar: str })
}
